package com.it.mapper;

import com.it.pojo.Books;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BooksMapper {


    @Select("Select * from books")
    List<Books> list();

    @Update("update books set bookname=#{bookname},img=#{img},money=#{money} where id=#{id}")
    void update(Books books);

    @Insert("insert into books(bookname,img,money)" +
            "values(#{bookname},#{img},#{money})")

    void add(Books books);

    @Delete("DELETE FROM books WHERE id = #{id}")
    void delete(Integer id);
}
